package com.cmwa.solution.sys.permission.post.entity;

import org.apache.commons.lang.StringUtils;
import org.apache.ibatis.type.Alias;

import com.cmwa.solution.base.entity.BaseVo;
import com.cmwa.solution.utils.Constant;
import com.cmwa.solution.utils.cached.DictionaryCached;

@Alias("postVo")
public class PostVo extends BaseVo {
	/**
	 * 岗位ID
	 */
	private String postId;
	/**
	 * 岗位名称
	 */
	private String postTitle;
	/**
	 * 岗位代码
	 */
	private String postCode;
	/**
	 * 岗位层级
	 */
	private String postRank;
	
	/**
	 * 岗位层级名称
	 */
	private String postRankName;
	
	/**
	 * 数据权限(COMP：公司；DEPT：部门)
	 */
	private String authority;
	/**
	 * 数据权限(中文)
	 */
	private String authorityName;
	/**
	 * 是否赋权
	 */
	private String isAuth;
	/**
	 * 是否赋权(中文)
	 */
	private String isAuthName;
	/**
	 * 是否页面配置
	 */
	private String isConf;
	/**
	 * 是否页面配置(中文)
	 */
	private String isConfName;
	/**
	 * 属性
	 */
	private String property;
	/**
	 * 属性(中文)
	 */
	private String propertyName;
	/**
	 * 备注
	 */
	private String remark;

	public String getPostId() {
		return postId;
	}

	public void setPostId(String postId) {
		this.postId = postId;
	}

	public String getPostTitle() {
		return postTitle;
	}

	public void setPostTitle(String postTitle) {
		this.postTitle = postTitle;
	}

	public String getPostCode() {
		return postCode;
	}

	public void setPostCode(String postCode) {
		this.postCode = postCode;
	}

	public String getPostRank() {
		return postRank;
	}

	public void setPostRank(String postRank) {
		this.postRank = postRank;
	}

	public String getAuthority() {
		return authority;
	}

	public void setAuthority(String authority) {
		this.authority = authority;
	}

	public String getIsAuth() {
		return isAuth;
	}

	public void setIsAuth(String isAuth) {
		this.isAuth = isAuth;
	}

	public String getIsConf() {
		return isConf;
	}

	public void setIsConf(String isConf) {
		this.isConf = isConf;
	}

	public String getProperty() {
		return property;
	}

	public void setProperty(String property) {
		this.property = property;
	}
	
	public String getStatusName(){
		if (Constant.C_STATUS_C.equals(status)) {
			return "已复核";
		}else if (Constant.C_STATUS_D.equals(status)) {
			return "已删除";
		}else {
			return "";
		}
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getPostRankName() {
		if (StringUtils.isNotEmpty(this.postRank)) {
			return DictionaryCached.getInstance().getDictionaryName(
					"ROLE_XXX_TYPE",
					"ROLE_XXX_TYPE",
					"ROLE_XXX_TYPE", this.postRank);
		}else if(postRankName == null){
			postRankName = "";
		}
		return postRankName;
	}

	public void setPostRankName(String postRankName) {
		this.postRankName = postRankName;
	}

	public String getIsAuthName() {
		if (Constant.C_STATUS_Y.equals(this.isAuth)) {
			isAuthName = "是";
		}else if (Constant.C_STATUS_N.equals(this.isAuth)) {
			isAuthName = "否";
		}
		return isAuthName;
	}

	public void setIsAuthName(String isAuthName) {
		this.isAuthName = isAuthName;
	}

	public String getIsConfName() {
		if (Constant.C_STATUS_Y.equals(this.isConf)) {
			isConfName = "是";
		}else if (Constant.C_STATUS_N.equals(this.isConf)) {
			isConfName = "否";
		}
		return isConfName;
	}

	public void setIsConfName(String isConfName) {
		this.isConfName = isConfName;
	}

	public String getAuthorityName() {
		return authorityName;
	}

	public void setAuthorityName(String authorityName) {
		this.authorityName = authorityName;
	}

	public String getPropertyName() {
		return propertyName;
	}

	public void setPropertyName(String propertyName) {
		this.propertyName = propertyName;
	}
	
	
}
